package com.gyx.lottery.common.exception;

import com.gyx.lottery.common.errorcode.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)

public class ControllerException extends RuntimeException{
    /**
     * @code 错误码
     * message 错误信息
     */
    private Integer code;
    private String message;
    public ControllerException(){

    }//进行序列化
    public ControllerException(Integer code,String message){
        this.code=code;
        this.message=message;
    }
    public ControllerException(ErrorCode errorCode){
        this.code=errorCode.getCode();
        this.message=errorCode.getMsg();
    }
}
